23300:
4b0692880dfa moved a check for 0 into p2m_flags_to_type()
and removed it from its caller, but the new check is only
compiled in 64-bit builds.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
/* Extract the type from the PTE flags that store it */
static inline p2m_type_t p2m_flags_to_type(unsigned long flags)
{
- /* Type is stored in the "available" bits */
-#ifdef __x86_64__
/* For AMD IOMMUs we need to use type 0 for plain RAM, but we need
* to make sure that an entirely empty PTE doesn't have RAM type */
if ( flags == 0 )
return p2m_invalid;
+#ifdef __x86_64__
/* AMD IOMMUs use bits 9-11 to encode next io page level and bits
* 59-62 for iommu flags so we can't use them to store p2m type info. */
return (flags >> 12) & 0x7f;